<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<div id="app">
  <h1>{{message}}</h1>
<!--  <button @click="but1">按钮1</button>-->
  <button @click="but1()">按钮1</button>
<!--  <button @click="but2">按钮1</button>-->
<!--  <button @click="but2()">按钮1</button>-->
<!--  <button @click="but2(abc)">按钮1</button>-->
  <button @click="but2('abc')">按钮2</button>
<!--  <button @click="but3">按钮3</button>-->
<!--  <button @click="but3('name',event)">按钮3</button>-->
  <button @click="but3('name',$event)">按钮3</button>
</div>

<script src="../js/vue.js"></script>
<script>
  //let(变量)和const(常量)
  const app = new Vue({
    el: '#app',
    data: {
      message: '中国牛蛙！'
    },
    methods: {
      but1() {
        console.log(this.message);
      },
      but2(name) {
        console.log('------------',name);
      },
      but3(name,event){
        console.log('------------',name,event)
      }
    }
  })
</script>

</body>
</html>